package com.hspedu.springboot.furn.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.math.BigDecimal;

/**
 * @Author 梁科
 * @Version 1.0
 * @ Date 2025/10/14 0:59
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "furn")      // 指定该JavaBean映射的数据库表名
public class Furn {
    @TableId(type = IdType.AUTO)    // 指定该属性对应数据库表中的主键，同时是自增长
    private Integer id;
    @NotEmpty(message = "请输入家居名")
    private String name;
    @NotEmpty(message = "请输入生产商")
    private String maker;
    @NotNull(message = "请输入价格")
    @Range(min = 0,message = "请输入正数")
    private BigDecimal price;
    @NotNull(message = "请输入销售量")
    @Range(min = 0,message = "请输入正数")
    private Integer sales;
    @NotNull(message = "请输入库存量")
    @Range(min = 0,message = "请输入正数")
    private Integer stock;
}
